package com.wkang.service.impl;

import com.wkang.dao.UserDao;
import com.wkang.pojo.User;
import com.wkang.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: wkang
 * @package: com.wkang.service.impl
 * @date: 2019/11/12
 * @version: ver1.0
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    /**
     * 根据ID查询用户信息
     * @param id
     * @return com.wkang.pojo.User
     */
    @Override
    public User findUserById(Integer id) {
        return userDao.findById(id).get();
    }
}
